package com.newlink.building.userinfo.mvp.model

import com.newlink.building.common_base.base.BaseModel
import com.newlink.building.common_base.http.Base_RetrofitHelper
import com.newlink.building.common_base.model.bean.*
import com.newlink.building.userinfo.mvp.contract.Module_UserInfo_AuthPasswordContract
import io.reactivex.Observable

/**
 * @author wangyang
 * @date 2022/9/20
 * @description 我的——关于页面的Model
 */
class Module_UserInfo_AuthPasswordModel : BaseModel(), Module_UserInfo_AuthPasswordContract.Model {

    override fun updateOpenDoorPassword(
        token: String,
        uId: String,
        password: String
    ): Observable<HttpResult<StatusData>> {
        val body = AuthRequestBody(keyInfo = password, keyType = AuthKeyTypePassword)
        val request = AddAuthRequest(
            accessToken = token,
            uId = uId,
            data = body
        )
        return Base_RetrofitHelper.service.addAuthKey(token, body)
//        return KcpTaskHelper.instance.requestAddAuth(request)
    }

    override fun getCardList(request: LoadFaceListDataRequest): Observable<HttpResult<FaceListData>> {
        return Base_RetrofitHelper.service.getAuthKeyList(request.accessToken, AuthKeyTypePassword)
//        KcpTaskHelper.instance.requestLoadFaceListData(request)
    }


}